import Vue from 'vue'
import App from './App.vue'
import router from './router'

// Vue.config.productionTip = false

// new Vue({
//   router,
//   render: h => h(App)
// }).$mount('#app')

let instance = null
function render(props) {
  instance = new Vue({
    router,
    render: h => h(App)
  }).$mount('#app');//这里是挂载到自己的html中，，基座会拿到这个挂在后的html 将其插入进去
}

// 子应用在qiankun中使用
if(window.__POWERED_BY_QIANKUN__){
  __webpack_public_path__ = window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__;
}
// 子应用独立使用
if (!window.__POWERED_BY_QIANKUN__) {
  render();
}
// 导出  子应用的协议
export const bootstrap = async (props) => {};
export const mount = async (props) => {
  console.log(props.a,'接受的参数');
  render(props)
};
export const unmount = async (props) => instance.$destroy();

// export async function bootstrap(props) {
  
// }
// export async function mount(props) {
//   render(props)
// }
// export async function unmount(props) {
//   instance.$destroy();
// }
